#include <stdio.h>
#include <stdlib.h>
struct node
{ int num;
  struct node *next;
};
typedef  struct node NODE;
int main() {
	NODE *head,*p1,*p2;
	int i,n=5;
	head=(NODE*)malloc(sizeof(NODE));
	head->num=-1;
	head->next=head;
	for(i=n;i>0;i--)
	{p1=(NODE*)malloc(sizeof(NODE));
	 p1->next=head->next;
	 p1->num=i;
	 head->next=p1;
	}
	while(p1->next!=head)
	{p1=p1->next;
	}
	p1->next=head->next;
	return 0;
}
